Put only GtkPaperSizes into the list, don't mix it with GtkPageSetups. Bug
authorChristian Persch <chpe@gnome.org>
Tue, 1 May 2007 22:31:29 +0000 (22:31 +0000)
committerChristian Persch <chpe@src.gnome.org>
Tue, 1 May 2007 22:31:29 +0000 (22:31 +0000)
2007-05-02  Christian Persch  <chpe@gnome.org>

* gtk/gtkpapersize.c: (gtk_paper_size_get_paper_sizes): Put only
GtkPaperSizes into the list, don't mix it with GtkPageSetups. Bug
#434861.

svn path=/trunk/; revision=17760

ChangeLog
gtk/gtkpapersize.c

index 27a7e6c9d1fe8ca81aad9a4640a9313cf3fc363a..6d4ef4c09fb061adef90baca0acbbf8ed65e9648 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-02  Christian Persch  <chpe@gnome.org>
+
+       * gtk/gtkpapersize.c: (gtk_paper_size_get_paper_sizes): Put only
+       GtkPaperSizes into the list, don't mix it with GtkPageSetups. Bug
+       #434861.
+
 2007-05-02  Christian Persch  <chpe@gnome.org>
 
        * gtk/gtkpapersize.c: (gtk_paper_size_new_from_info),
index db6a34b98724a722016726a831d8f1d8d031041c..4c014808a0fe09e6826d985329ad5ac31f29fed8 100644 (file)
@@ -455,8 +455,23 @@ gtk_paper_size_get_paper_sizes (gboolean include_custom)
   GList *list = NULL;
   guint i;
 #ifdef G_OS_UNIX               /* _gtk_load_custom_papers() only on Unix so far  */
-  if (include_custom) 
-    list = _gtk_load_custom_papers ();
+  if (include_custom)
+    {
+      GList *page_setups, *l;
+
+      page_setups = _gtk_load_custom_papers ();
+      for (l = page_setups; l != NULL; l = l->next)
+        {
+          GtkPageSetup *setup = (GtkPageSetup *) l->data;
+          GtkPaperSize *size;
+
+          size = gtk_page_setup_get_paper_size (setup);
+          list = g_list_prepend (list, gtk_paper_size_copy (size));
+        }
+
+      g_list_foreach (page_setups, (GFunc) g_object_unref, NULL);
+      g_list_free (page_setups);
+    }
 #endif
   for (i = 0; i < G_N_ELEMENTS (standard_names_offsets); ++i)
     {